package services;

import gestures.dragGestures.*;
import gestures.pinchPullGestures.*;
import gestures.slideGestures.*;
import gestures.tapGestures.*;

import java.util.HashMap;

import services.subscribers.dragGestures.*;
import services.subscribers.pinchPullGestures.*;
import services.subscribers.slideGestures.*;
import services.subscribers.tapGestures.*;

/**
 * Contains mapping of gestures to associated event listener interfaces
 * 
 * @author PDAY (The MITRE Corporation)
 * 
 */
public class GestureEventMap {
	/**
	 * Map of gesture classes to their appropriate event listeners
	 */
	public final static HashMap<Class<?>, Class<?>[]> GESTURE_EVENT_MAP = new HashMap<Class<?>, Class<?>[]>();
	static {
		// Tap, doubletap maps
		GESTURE_EVENT_MAP.put(TapGesture.class, new Class<?>[] { ITapGestureListener.class });
		GESTURE_EVENT_MAP.put(DoubleTapGesture.class,
				new Class<?>[] { IDoubleTapGestureListener.class });

		// Drag Gestures
		GESTURE_EVENT_MAP.put(DragGestureStart.class,
				new Class<?>[] { IDragGestureStartListener.class });
		GESTURE_EVENT_MAP.put(DragGestureChange.class,
				new Class<?>[] { IDraggingGestureListener.class });
		GESTURE_EVENT_MAP.put(DragGestureEnd.class,
				new Class<?>[] { IDragGestureComplete.class });

		// Slide Gestures
		GESTURE_EVENT_MAP.put(SlideGestureStart.class,
				new Class<?>[] { ISlideGestureStartListener.class });
		GESTURE_EVENT_MAP.put(SlideGestureChange.class,
				new Class<?>[] { ISlidingGestureListener.class });
		GESTURE_EVENT_MAP.put(SlideGestureEnd.class,
				new Class<?>[] { ISlideGestureCompleteListener.class });

		// Pinch maps
		GESTURE_EVENT_MAP.put(PinchGestureStart.class,
				new Class<?>[] { IPinchGestureStartListener.class });
		GESTURE_EVENT_MAP.put(PinchingGesture.class,
				new Class<?>[] { IPinchingGestureListener.class });
		GESTURE_EVENT_MAP.put(PinchGestureComplete.class,
				new Class<?>[] { IPinchGestureCompleteListener.class });

		// Pull maps
		GESTURE_EVENT_MAP.put(PullGestureStart.class,
				new Class<?>[] { IPullGestureStartListener.class });
		GESTURE_EVENT_MAP.put(PullingGesture.class,
				new Class<?>[] { IPullingGestureListener.class });
		GESTURE_EVENT_MAP.put(PullGestureComplete.class,
				new Class<?>[] { IPullGestureCompleteListener.class });
	}
}
